fix(extract): resolve Go route paths built via string concatenation - #1400
fix(extract): resolve Go route paths built via string concatenation#1400AmirF194 wants to merge 1 commit into
Conversation
r.HandleFunc(base+"/login", handler) fell through extract_positional_url with no branch for binary_expression, so first_string_arg stayed NULL. A real BFF with 47 such registrations (all base+"literal") produced only 9 Route nodes. Recover the literal suffix from the right-hand operand of a "+" concatenation; a right side that is not itself a literal is left unresolved rather than guessed. Fixes DeusData#1249 Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for the Go route-path contribution and the concatenation-focused regression coverage. It is now triaged as a high-priority parsing fix in |
What does this PR do?
r.HandleFunc(base+"/login", loginHandler)and outbound calls built the same way ("http://" + host + ":" + port + "/log") were not indexed:extract_positional_url(internal/cbm/extract_calls.c) has no branch forbinary_expression, the AST node Go's+produces, so the argument falls through andfirst_string_argstays NULL. On the reporter's real BFF (47HandleFuncregistrations, allBaseURL+"literal"), the graph contained only 9 Route nodes.Added
extract_binary_concat_suffix: for a+concatenation, recover the literal string on the right-hand side (the config-prefix pattern this issue describes). When the right side is not itself a literal, the call is left unresolved rather than guessing a path, matching the reporter's own expected behavior.Checklist
git commit -s)make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)Verification
extract_go_binary_concat_url_issue1249) fails on unmodifiedmain(first_string_arg is NULL) and passes on this branch, covering both the mux registration and the outbound-URL case from the issue.base+suffixVar) still resolves to no route, so nothing is fabricated.extractionsuite (273 tests) passes under ASan+UBSan;scripts/lint.sh --ci(cppcheck + clang-format) is clean on the changed files.extraction, and the macOS/Windows CI legs (no such runners here).Fixes #1249